package com.jdbctemplate.service.impl;

import com.jdbctemplate.dao.StudentInfoDao;
import com.jdbctemplate.dao.impl.StudentInfoDaoImpl;
import com.jdbctemplate.pojo.StudentInfo;
import com.jdbctemplate.service.StudentInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


/**
 * @author 从卿
 * @create 2022/5/31-20:38
 */
@Service
public class StudentInfoServiceImpl implements StudentInfoService {
    @Autowired
     private  StudentInfoDao studentInfoDao;
    @Override
    public int  addStudent(StudentInfo studentinfo) {
        return this.studentInfoDao.insertStudent(studentinfo);
    }

    @Override
    public int updateStu(StudentInfo student) {
        return this.studentInfoDao.updateStudent(student);
    }

    @Override
    public StudentInfo preUpdateStu(String name) {
        return this.studentInfoDao.findStuByName(name);
    }

    @Override
    public List<StudentInfo> showStu() {
        return this.studentInfoDao.selectStu();
    }
}
